// pages/product/product.js
let app = getApp();
var util = require('../../utils/util.js');
Page({

  /**
   * 页面的初始数据
   */
  data: {
    product_card:[
      { name: '加油卡', pic: '/images/product_01.png', url:'../refuelling/refuelling' },
      { name: '二手车', pic: '/images/product_05.png', url: '../issue/issue' },
      { name: '汽车保险', pic: '/images/product_02.png', url: '../carInsurance/carInsurance' },
      { name: '车辆维修', pic: '/images/product_03.png', url:'../carService/carService'},
      { name: '汽配商城', pic: '/images/product_04.png', url: '../carStore/carStore'},
     
    ],
    banner:[]
  },
  start_product(e){
    var url = e.currentTarget.dataset.url;
    app.navTo(url)
  },
  get_banner_data(){
    var that = this;
    util.commonRequest('qipeibanner', 'post', '', function (res) {
      if (res.data.code == 200) {
        that.setData({
          banner: res.data.data
        })
      } else {
        wx.showToast({
          icon: 'none',
          title: res.data.msg,
        })
      }
    });
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.get_banner_data()
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})